﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using ClassLibrary.DAO;
using ClassLibrary.Entity;

public partial class Admin_MasterPage : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session[Global.SESSION_LOGGED_ADMIN] != null)
            lName.Text = ((TblAccounts)Session[Global.SESSION_LOGGED_ADMIN]).FirstName + " " + ((TblAccounts)Session[Global.SESSION_LOGGED_ADMIN]).LastName;
        lTime.Text = DateTime.Now.ToString("dd/MM/yyyy hh:mm");
    }

    protected void btnLogout_Click(object sender, EventArgs e)
    {
        try
        {
            Session[Global.SESSION_LOGGED_ADMIN] = null;
            Session.RemoveAll();
            Session.Clear();
            Response.Redirect("~/Admin/AdminLogin.aspx", false);
        }
        catch (Exception ex)
        {
            Session[Global.SESSION_ERROR] = ex;
            Response.Redirect("~/Admin/AdminLogin.aspx", false);
        }
    }
}
